package test3;

public class Demo {
}

class Master{
    public void feed(Pet pet){
        pet.eat();
    }
}

//父类
abstract class Pet{

     abstract void eat();
}

class Dog extends Pet{

    @Override
    void eat() {
        System.out.println("小狗吃骨头");
    }
}
class Cat extends Pet{

    @Override
    void eat() {
        System.out.println("小猫吃鱼");
    }
}
